import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ContentAuditsVO, ContentAuditsForm, ContentAuditsQuery } from '@/api/content/contentAudits/types';

/**
 * 查询内容审核列表
 * @param query
 * @returns {*}
 */

export const listContentAudits = (query?: ContentAuditsQuery): AxiosPromise<ContentAuditsVO[]> => {
  return request({
    url: '/content/contentAudits/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询内容审核详细
 * @param auditId
 */
export const getContentAudits = (auditId: string | number): AxiosPromise<ContentAuditsVO> => {
  return request({
    url: '/content/contentAudits/' + auditId,
    method: 'get'
  });
};

/**
 * 新增内容审核
 * @param data
 */
export const addContentAudits = (data: ContentAuditsForm) => {
  return request({
    url: '/content/contentAudits',
    method: 'post',
    data: data
  });
};

/**
 * 修改内容审核
 * @param data
 */
export const updateContentAudits = (data: ContentAuditsForm) => {
  return request({
    url: '/content/contentAudits',
    method: 'put',
    data: data
  });
};

/**
 * 删除内容审核
 * @param auditId
 */
export const delContentAudits = (auditId: string | number | Array<string | number>) => {
  return request({
    url: '/content/contentAudits/' + auditId,
    method: 'delete'
  });
};
